import * as types from './type';

export const loadingScreenView = (value) => ({
    type: types.SYSTEM_WINDOW_LOADING,
    value
})

export const systemWindowWidth = (value) => ({
    type: types.SYSTEM_WINDOW_WIDTH,
    /*默认添加单位：像素px*/
    value: value.endsWith('px' || 'em' || 'rem' || '%' || 'ex' || 'ch') ? value : value + 'px'
})

export const systemWindowHeight = (value) => ({
    type: types.SYSTEM_WINDOW_HEIGHT,
    /*默认添加单位：像素px*/
    value: value.endsWith('px' || 'em' || 'rem' || '%' || 'ex' || 'ch') ? value : value + 'px'
})

export const systemWindowSize = (value) => ({
    type: types.SYSTEM_WINDOW_SIZE,
    /* 属性值对象 {width:'xxx px' , height:'xxx px'} */
    value
})

export const systemWindowHeadFixed = (value) => ({
    type: types.SYSTEM_WINDOW_HEAD_FIXED,
    value:!!value
})

export const systemWindowScroll = (value) => ({
    type: types.SYSTEM_WINDOW_SCROLL,
    value:!!value
})

export const saveVerificationCode = (value) => ({
    type: types.SYSTEM_WINDOW_VERIFICATION_CODE,
    value
})

export const setWindowRouter = (value) => ({
    type: types.SYSTEM_WINDOW_ROUTER,
    value
})

//
// export const webSocket2init = (value)=> ({
//     type:types.SYSTEM_WINDOW_SOCKET_INIT,
//     value
// })
